//
//  UIColor+SCBaseExt.m
//  SCFoundationKit
//
//  Created by Chao Sheng on 2023/10/13.
//

#import "UIColor+SCBaseExt.h"

@implementation UIColor (SCBaseExt)

+ (UIColor *)sc_colorWithHex:(long)hex {
    
    return [UIColor sc_colorWithHex:hex alpha:1];
}

+ (UIColor *)sc_colorWithHex:(long)hex alpha:(float)alpha {
    float red = ((float)((hex & 0xFF0000) >> 16))/255.0;
    float green = ((float)((hex & 0xFF00) >> 8))/255.0;
    float blue = ((float)(hex & 0xFF))/255.0;

    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}

@end
